package com.gexiao.aop.config;

import com.gexiao.aop.aspects.LogAspects;
import com.gexiao.aop.bean.MatchCalculator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@Configuration
@EnableAspectJAutoProxy
@ComponentScan("com.gexiao.aop")
public class MainConfigOfAOP {

    //业务逻辑类加入到容器
    @Bean
    public MatchCalculator matchCalculator(){
        return new MatchCalculator();
    }

    //切面类加入到容器中
    @Bean
    public LogAspects logAspects(){
        return new LogAspects();
    }
}
